#include <stdbool.h>
bool detectCapitalUse(char* word) 
{   
    int upcount=0;
    int lowcount=0;
    if(strlen(word)==1)
    return true;
    else
    { 
        for(int i=0;i<strlen(word);i++)
        {
            if(word[i]>='A'&&word[i]<='Z')
            {
                upcount++;
            }
            if(word[i]<='z'&&word[i]>='a')
            {
                lowcount++;
            }
        }
        if(upcount==strlen(word)||lowcount==strlen(word))
        {

            return true;
        }
        if(upcount==1)
        if(word[0]>='A'&&word[0]<='Z')
        {
            return true;
        }
    }  
        return false;
}
